-
Notifications
You must be signed in to change notification settings - Fork 283
✨ Feature: restrict API Server LB access via IPs #1247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Feature: restrict API Server LB access via IPs #1247
Conversation
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Hi @bavarianbidi. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/ok-to-test |
|
/test pull-cluster-api-provider-openstack-test |
wondering why this test doesn't fail on my local machine 🤷 will fix it on monday |
|
looks like this is Fuzzy test failure :) so need check the Convert function failure |
12abd16 to
8922a62
Compare
had to rebase again, as |
seanschneeweiss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. Thanks a lot for the documentation too. This is a great feature.
tobiasgiese
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this great contribution! 👌🏻
* Access to API-Server can be restricted by setting allowedCidrs on spec.APIServerLoadBalancer.AllowedCIDRs field * Default LB provider is set to amphora if multiple providers exist. Features like access restriction via IPs is only supported in amphora. * Outgoing NAT Router-IPs are now part of the OpenStackCluster status. * To support the entire feature set of conversion, the cluster.x-k8s.io/conversion-data annotation got introduced if quering objects in a previous api version. * make generate now regenerate the mock loadbalancer_service client if needed Signed-off-by: Mario Constanti <[email protected]>
463c45f to
e78f0b8
Compare
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bavarianbidi, tobiasgiese The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/unhold |
Access to API-Server can be restricted by setting allowedCidrs on
spec.APIServerLoadBalancer.AllowedCIDRs.Behavior:
cluster-api-provider-openstack/pkg/cloud/services/networking/router.go
Lines 73 to 83 in 9830f57
spec.APIServerLoadBalancer.AllowedCIDRschanged (create/update), CAPO will fetch all known required IP addresses from spec and status and will generate a new list of allowed CIDRscluster-api-provider-openstack/pkg/cloud/services/loadbalancer/loadbalancer.go
Lines 193 to 207 in 9830f57
allowed_cidrson OpenStack are updated on the corresponding listener, the list of applied CIDRs will be written back to the statuscluster-api-provider-openstack/pkg/cloud/services/loadbalancer/loadbalancer.go
Lines 113 to 119 in 9830f57
Conclusion:
spec.APIServerLoadBalancer.AllowedCIDRsis now mutableOpen questions:
current implementation doesn't validate IPs during creation/editing of cluster-spec. IP validation will be done afterwards and non-valid IPs will get removed.
Is this ok or should we already validate the CIDRs in the webhook?
Signed-off-by: Mario Constanti [email protected]
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #1045
Special notes for your reviewer:
With
cluster-api-provider-openstack/api/v1alpha4/conversion.go
Lines 36 to 40 in 9830f57
cluster-api-provider-openstack/api/v1alpha4/conversion.go
Lines 62 to 65 in 9830f57
cluster.x-k8s.io/conversion-dataAnnotation if we query CAPO-related resources in a previous CAPO-Version.This is currently missing but needed in general.
E.g. compare the output of
k get cluster.v1alpha4.cluster.x-k8s.ioandk get cluster.v1beta1.cluster.x-k8s.iowhere conversion is fine versus CAPO - e.g.k get osc.v1alpha4.infrastructure.cluster.x-k8s.iowhere we don't have thecluster.x-k8s.io/conversion-dataannotation yet.xref: SIG Cluster Lifecycle - ClusterAPI - API conversion code walkthrough
TODOs:
/hold